#include <sys/stat.h>
#include <sys/types.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <time.h>

int main(int argc, char **argv)
{
    FILE *fp = fopen("numbers.txt", "w");

    srand(time(NULL));

    int i;
    for(i=0; i<1000*1000; i++)
    {
        fprintf(fp, "%u\n", rand()%((int)pow(10, rand()%8+5)));
    }

    fclose(fp);

    return 0;
}